#include <iostream>
#include <cmath>
using namespace std;
using ll = long long;
bool isprime(ll x) {
    
    if (x < 2)
        return false;
    for (int i = 2; i <= sqrt(x); i++) {
        if (x % i == 0)
        {
            return false;
        }
            
    }
    return true;
}
bool check(ll x) {
    string s = to_string(x);

    int l = 0, r = s.size() - 1;
    while (l < r) {
        if (s[l] != s[r])
            return false;
        l++;
        r--;
    }
    return true;
}
string oper(ll x) {
    string s = to_string(x);
    int en = s.size() - 1;
    int l = s.size() - 2;
    while (l>=0) {
        s.push_back(s[l]);
        l--;
    }
    return s;
}
int main() {
    ll x;
    cin >> x;
    if (check(x)) {
        if(isprime(x))
        {
            cout << "prime" << endl;
        }
        else{
            cout << "noprime" << endl;
        }
        
    } else {
        string ret = oper(x);
        if (isprime(stoll(ret))) {
            cout << "prime" << endl;
        } else {
            cout << "noprime" << endl;
        }
    }
    return 0;
}
